/***
 * 页面初始化
 * */
$(document).ready(function () {
    treeObj = mini.get("menuTree");
    initTree();
});

/***
 * 加载树
 * */
function initTree() {
    Tree.getTree(treeObj, "sysAttachMenu!list.do", "attachMenuId", "parentId");
}

function menuSelected(e) {
    var tree = e.sender;
    var node = e.node;
    currentTreeNode = node;
    var grid=mini.get("attachgrid");
    grid.load({"attachMenuView.menuIdPath":currentTreeNode.attachMenuId})
}

function formatOper(e){
    return"<a class='mini-button' hideFocus='' href='javascript:void(0)' onClick='downloadfile(\""+e.value+"\")'><span class='mini-button-text  mini-button-icon icon-edit'>下载</span></a>";
}

function downloadfile(id) {
    var url =getfile(id,'0');
    window.open(url);
}